package com.ruoyi.system.api.service.impl;

import com.ruoyi.system.api.ResponseWithData;
import com.ruoyi.system.api.service.CcService;
import com.ruoyi.system.api.service.ReportPreviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ReportPreviewServiceImpl implements ReportPreviewService {

    /** 调用CC接口service */
    @Autowired
    private CcService ccService;

    @Override
    public ResponseWithData fieldServiceReport(String reportGuid, String serviceNo, String enginnerId) throws Exception {
        String result = ccService.syncServiceReport(reportGuid, serviceNo, enginnerId);
        return new ResponseWithData().success(result).code(200);
    }

    @Override
    public ResponseWithData installationQualityReport(String reportGuid, String serviceNo, String enginnerId) throws Exception {
        String result = ccService.syncInstallqualityReport(reportGuid, serviceNo, enginnerId);
        return new ResponseWithData().success(result).code(200);
    }

    @Override
    public ResponseWithData inspectionReport(String reportGuid, String serviceNo, String enginnerId) throws Exception {
        String result = ccService.syncInstallReceivingReport(reportGuid, serviceNo, enginnerId);
        return new ResponseWithData().success(result).code(200);
    }
}
